package icrts;

import java.util.HashSet;
import icrts.logic.*;
import icrts.display.*;

public class GameManager {
	static private boolean created = false;	
	static private HashSet<AbstractGameObject> gameState
                = new HashSet<AbstractGameObject>();

    static public MapPanel gameMap;

	static public HashSet<AbstractGameObject> getGameState(){
            if (!created) {
                GameManager();
                created = true;
            }
            return gameState;
	}

	static private void GameManager(){
           gameState.add(new SampleRangedUnit(new Position(50,60)));
    }

	static public void createNewBuilding(int x, int y){
            gameState.add(new SampleBuilding(new Position(x, y)));
	}
        /**
         * This method allows the overall game state to be set by the Universe.
         * @param gS game state.
         */
    static public void setGameState(HashSet<AbstractGameObject> gS) {
            gameState.clear();
            gameState = (HashSet<AbstractGameObject>) gS.clone();
        }

   static public void add(MapPanel newGameMap){
        
            if (!created) {
                GameManager();
                created = true;
            }

            gameMap = newGameMap;
          
    }

}



